package com.tian.common.core.page;

import com.tian.common.constants.Pagination;
import com.tian.common.utils.ServletUtils;

/**
 * 表格数据处理
 *
 * @author zxy
 */
public class TableSupport {
    /**
     * 封装分页对象
     */
    public static PageDomain getPageDomain() {
        PageDomain pageDomain = new PageDomain();
        pageDomain.setPageNum(ServletUtils.getParameterToInt(Pagination.pageNum));
        pageDomain.setPageSize(ServletUtils.getParameterToInt(Pagination.pageSize));
        pageDomain.setOrderBy(ServletUtils.getParameter(Pagination.orderBy));
        pageDomain.setSort(ServletUtils.getParameter(Pagination.sort));
        return pageDomain;
    }

    public static PageDomain buildPageRequest() {
        return getPageDomain();
    }
}
